﻿<?php
session_start();
require_once('../config.php');
function check($str){
    return str_replace("'","''",$str);
}
if($_SESSION["islogin"]!=='igiveyouthepower'){
echo "<script language=JavaScript>\r\n";
echo "alert('请先登录!');\r\n";
echo "location.href='/admin/manage_login.html'\r\n";
echo "</script>";
}else{
$conn = mysql_connect($cfg_dbhost,$cfg_dbuser,$cfg_dbpwd);
mysql_select_db($cfg_dbname,$conn);
$merNo=check($_POST["merNo"]);
$terNo=check($_POST["terNo"]);
$signKey=check($_POST["signKey"]);


$sql = "update ph_pay set merNo='".$merNo."',terNo='".$terNo."',signKey='".$signKey."' where id=1";
mysql_query($sql,$conn);
// echo $sql;
// exit;
echo "<script language=JavaScript>\r\n";
echo "alert('修改成功!');\r\n";
echo "location.href='pay.php'\r\n";
echo "</script>";
}
?>